Python Essentials 1 by The OpenEDG Python Institute

Python Essentials 1 by The OpenEDG Python Institute

Author:The OpenEDG Python Institute
Language: eng
Format: epub
Published: 2022-12-14T14:21:40+00:00


3.3.3 Logical values vs. single bits

Logical operators take their arguments as a whole regardless of how many bits they contain. The operators are aware only of the value: zero (when all the bits are reset) means False; not zero (when at least one bit is set) means True.

The result of their operations is one of these values: False or True. This means that this snippet will assign the value True to the j variable if i is not zero; otherwise, it will be False.

i = 1

j = not not i

3.3.4 Bitwise operators



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.